package com.ruoyi.system.service;

import org.springframework.data.redis.core.script.RedisScript;

import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;

public interface IRedisOperation {
    Boolean hasKey(String key);

    void setValue(String key, String value);

    void setSetValue(String key, Long timeout, String... values);

    void setHashValue(String key, String hashKey, String hashValue);

    void setHashAllValue(String key, Map<String, String> var2);

    void setHashValue(String key, String hashKey, String hashValue, Long timeout);

    void setValue(String key, String value, Long timeout);

    void setValue(String key, String value, Long timeout, TimeUnit unit);

    void setValuePermanent(String key, String value);

    String getValue(String key);

    String getAndSetValue(String key, String value);

    Set<String> getSetValues(String key);

    Boolean isMember(String key, String value);

    Long getSetSize(String key);

    String getHashValue(String key, String hashKey);

    List getHashValues(String key);

    List<String> mutiGetHashValue(String key, List<String> hashKeys);

    void removeHashEntry(String key, String... hashKey);

    void removeKey(String key);

    void removeSetEntry(String setkey, String... setValue);

    Set<String> getHashKeys(String key);

    List<String> getValues(String prex);

    void removeV(String key);

    boolean putIfAbsent(String key, String value);

    boolean putIfAbsent(String key, String value, Long timeout, TimeUnit timeUnit);

    String batchRemoveByPrexKey(String prex);

    String batchRemoveByKeys(String keyListStr, String splitChar);

    void increaseKey(String key, int num, Long timeout, TimeUnit timeUnit);

    long increaseKeyValue(String key, int num);

    void longExpire(String key, final long timeout, final TimeUnit unit);

    long getExpire(String key, TimeUnit timeUnit);

    String rightPop(String key);

    List<String> range(String key, long start, long end);

    void listPush(String key, String value, long timeout);

    void zsetAdd(String key, String value, double score, long timeout);

    Set<String> rangeByScore(String key, double min, double max);

    Set<String> rangeByScore(String key, double min, double max, long offset, long count);

    Set<String> zRange(String key, long begin, long end);

    Set<String> zrevRangeByScoreLimit(String key, double min, double max, long limit);

    Set<String> zrevRangeByScore(String key, double min, double max);

    List<String> executePipeline(final List<String> keys, final double min, final double max);

    void batchDelete(final List<String> keys);

    List<String> batchZget(final List<String> keys, final double max, final double min);

    String deserialize(byte[] body);

    void convertAndSend(String channel, String message);

    void batchZsetAdd(List<String> keys, List<String> values, double score, long timeout);

    void publishMessage(String channel, String event, String data);

    void produceMessage(String channel, String event, String data);

    String loadScript(RedisScript redisScript);

    void setOpsLog(String key, String... value);

    Long opsLogSize(String key);
}
